/*
 * Created on Sun Sep 17 2017
 * @flow
 * Copyright (c) 2017 jianglinjie
 */
'use strict';
import type { NetStrategy } from '../strategy/NetStrategy';
import type NetRequest from '../request/NetRequest';
import type NetworkReponse from '../strategy/NetworkReponse';

export default class NetTask {
  request: NetRequest;
  strategy: NetStrategy;

  constructor(request: NetRequest, strategy: NetStrategy) {
    this.request = request;
    this.strategy = strategy;
  }

  start(): Promise<NetworkReponse> {
    return this.strategy.start(this.request);
  }
}